<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class CreateRebateRateTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('rebate_rate', function (Blueprint $table) {
            $table->increments('id');
            $table->decimal('BNF_Lv1')->comment('一级分销比例')->default(0);
            $table->decimal('BNF_Lv2')->comment('一级分销比例')->default(0);
            $table->decimal('BNF_Lv3')->comment('一级分销比例')->default(0);
//            $table->decimal('BNF_Lv4')->comment('一级分销比例')->default(0);
            $table->timestamp('updated_at')->comment('修改时间')->default(DB::raw('CURRENT_TIMESTAMP'));
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('rebate_rate');
    }
}
